Subject: Re: how do the math libraries work?
From: [email-masked] ()
Date: 7 Apr 1994 22:09:29 GMT
Newsgroups: comp.sys.amiga.programmer

mail delivery system here says "rs6nltc.torolab.ibm.com"? Host
unknown!, so I post instead:

In comp.sys.amiga.programmer you write:

>Someone told me that if I use the math libraries in my C programs,
>they will automatically use a math co-processor if it is
>available, yet will still work on machines that lack one.
>Is this true?

Yes, for the IEEE math libraries. No for the ffp libraries.
When the IEEE libraries are opened for the first time they
look around for

 1) an 6888x hooked directly to the cpu (by looking at the AttnFlags in execbase
 2) a memory mapped 6888x or equivalent (by looking for a IEEEMathResource)
 3) and if neither is found, they use their own software routines.

Once the library has decided how it is going to do its math, it
creates its jump table so that the library vectors go straight to
the correct routines. (This way it doesn't spend time deciding how
to perform each math operation each time it is asked to perform a
math operation).

The IEEEMathResource lets you have an 6888x in a 68000 system.

-Nicolas Dade / n9rzb / [email-masked]